<template>
  <v-app>
    <v-main>
      mail
      <v-btn @click="openTemp(500, 500)">在右侧打开100*500</v-btn>
      <v-btn @click="openTemp(1000, 1000)">在右侧打开1000*1000</v-btn>
      <v-btn @click="notify">notify</v-btn>
    </v-main>
  </v-app>
</template>

<script lang="ts" setup>
import { useSystemStateListener } from '@/composables/useSystemStateListener'
import { getSystemTab } from '~shared/utils/tab'
import { TAB_IDS } from '~shared/constants'
import { notifySuccess } from '@/utils/notify'
// 启动系统状态监听器
useSystemStateListener()

function openTemp(width: number, height: number) {
  _pre_.browser.addTab(
    [
      getSystemTab(TAB_IDS.PROCESS_MONITOR, {
        isInSeparateWindow: true,
        separateConfig: { width, height }
      })
      // getSystemTab(TAB_IDS.SETTINGS)
    ],
    'right'
  )
}

function notify() {
  notifySuccess('test', 'ttttttt', {
    timeout: 0,
    position: 'bottom-right',
    actions: [
      {
        label: 'click-test',
        onClick: () => {
          alert('test')
        }
      }
    ]
  })
}
</script>
